<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<div>
    <p><input  id="r" type="text" ></p>
    <p><input  id="cir" type="text"></p>
    <p><input  id="area" type="text"></p>
</div>
<script>
    var r = prompt("请输入圆的半径");
    r=parseFloat(r) && Number(r);
    if(!isNaN(r)){
        var area=Math.PI*r*r;
        var cir= 2*Math.PI*r;
        document.getElementById('r').value= r;
        document.getElementById('cir').value=cir.toFixed(2);
        document.getElementById('area').value=area.toFixed(2);
    }else{
        alert("请输入正确的数字")
    }
</script>
</body>
</html>